<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		Broadcastweb.eu - Paules												/
/	Site:			http://www.broadcastweb.eu												/
/	Email:			support@broadcastweb.eu													/
/	Copyright:		2011 - 2012 (c) Broadcastweb.eu											/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0003																	/
/																							/
/========================================== JooSam ========================================*/

// Joomla security
defined('_JEXEC') or die;

## Import Joomla Data
JHtml::_('behavior.tooltip');
$srvActive = $this->srvActive;
$srvOnEdit = $this->srvOnEdit;
?>
<table class="jsmRight" style="float:right;min-width:120px;border:none;margin:0 0 10px 10px;padding:0;">
	<tr>
		<th class="jsm_TableHead" colspan="2" style="font-size:13px; color:#0080ff;"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_004'); ?></th>
	<tr>
		<td class="jsm_label" style="font-size:11px; font-weight:bold; width:90px;"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_005'); ?>: </td>
		<td class="jsm_value" style="font-size:12px; color:#ff8000; font-weight:bold;"><?php echo $srvActive['name']; ?></td>
	</tr>
	<tr>
		<td class="jsm_label" style="font-size:11px; font-weight:bold; width:90px;"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_006'); ?>: </td>
		<td class="jsm_value" style="font-size:12px; color:#ff8000; font-weight:bold;"><?php echo $srvOnEdit['name']; ?></td>
	</tr>
</table>
<div class="clr"></div>
<!-- Form start -->
<form action="<?php echo JRoute::_('index.php?option=com_joosam&view=servers'); ?>" method="post" name="adminForm" id="adminForm">
	<fieldset class="jsm_fieldset">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="5"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_007'); ?></th>
					<th width="35"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_008'); ?></th>
					<th width="120"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_009'); ?></th>
					<th><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_010'); ?></th>
					<th width="100"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_011'); ?></th>
					<th width="60"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_012'); ?></th>
					<th width="100"><?php echo JText::_('COM_JOOSAM_VIEWS_SERVERS_013'); ?></th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($this->items as $i => $item): 
					$canDo	= JoosamHelper::getActions();
					$canEdit = $canDo->get('core.edit');
					$canState = $canDo->get('core.edit.state'); ?>
					<tr class="row<?php echo $i % 2; ?>">
				<!--1--><td class="center">
							<?php echo $item->id; ?>
						</td>
				<!--2--><td style="text-align:center; padding:0 0 0 15px;">
							<?php echo JHtml::_('grid.id', $i, $item->id); ?>
						</td>
				<!--3--><td class="center"><?php
							if($item->srv_name == ''){
								echo JText::_('COM_JOOSAM_VIEWS_SERVERS_014');
							}
							else{
								echo $item->srv_name;
							} ?>
						</td>
				<!--4--><td><?php
							if($item->srv_descr == ''){
								echo JText::_('COM_JOOSAM_VIEWS_SERVERS_015');
							}
							else{
								echo $item->srv_descr;
							} ?>
						</td>
				<!--5--><td class="center"><?php
							$srv_activate = JRoute::_('index.php?option=com_joosam&task=servers.switchto&id='.$item->id);
							$srv_txt_Activate = JText::_('COM_JOOSAM_VIEWS_SERVERS_016');
							$srv_txt_ActNoClick = JText::_('COM_JOOSAM_VIEWS_SERVERS_017');
							if($item->srv_active != 1 and $canState == true){
								echo '<a class="jgrid jsm_ActiveLink" href="'.$srv_activate.'" title="'.$srv_txt_Activate.'"><span class="state unpublish"><span class="text">'.$srv_txt_Activate.'</span></span></a>';
							}
							else{
								echo '<a class="jgrid jsm_ActiveLink" onclick="return false;" href="#" title="'.$srv_txt_ActNoClick.'"><span class="state publish"><span class="text">'.$srv_txt_ActNoClick.'</span></span></a>';
							} ?>
						</td>
				<!--6--><td class="center"><?php
							$srv_setadmin = JRoute::_('index.php?option=com_joosam&task=servers.setadmin&id='.$item->id);
							$srv_txt_SetAdmin = JText::_('COM_JOOSAM_VIEWS_SERVERS_018');
							$srv_txt_AdmNoClick = JText::_('COM_JOOSAM_VIEWS_SERVERS_019');
							if($item->set_admin != 1 and $canEdit == true){
								echo '<a class="jgrid jsm_AdmEditLink" href="'.$srv_setadmin.'" title="'.$srv_txt_SetAdmin.'"><span class="state unpublish"><span class="text">'.$srv_txt_SetAdmin.'</span></span></a>';
							}
							else{
								echo '<a class="jgrid jsm_AdmEditLink" onclick="return false;" href="#" title="'.$srv_txt_AdmNoClick.'"><span class="state publish"><span class="text">'.$srv_txt_AdmNoClick.'</span></span></a>';
							} ?>
						</td>
				<!--7--><td class="center"><?php
							if($canEdit == true){
								$srv_testServer = JRoute::_('index.php?option=com_joosam&task=servers.testconnect&id='.$item->id);
								$srv_txt_testServer = JText::_('COM_JOOSAM_VIEWS_SERVERS_020');
								echo '<a class="jgrid jsm_TestLink" href="'.$srv_testServer.'" title="'.$srv_txt_testServer.'"><span class="state pending"><span class="text">'.$srv_txt_testServer.'</span></span></a>';
							} ?>
						</td>
					</tr>
				<?php endforeach; ?>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="7"><?php echo $this->pagination->getListFooter(); ?></td>
				</tr>
			</tfoot>
		</table>
	</fieldset>
	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</form>
<div class="clr"></div>